﻿using Script.UI.Component;
using System.Collections.Generic;
using MTUnity.Utils;

namespace Script.UI
{
    
    public class SpanelWndData
    {
        public UI_Energy_Data EnergyPanelData;
        public SortingPanelData SortingPanelData;
        public CheckNumPanelData CheckNumPanelData;
    }

    public class UI_Energy_Data
    {
        public class UI_Energy_Data_Record
        {
            public float EnergyConsumption;
            public long Timestamp;
        }

        public float CurrentEngeryConsumption;
        public List<UI_Energy_Data_Record> EnergyRecord = new List<UI_Energy_Data_Record>();
    }

    public class SortingPanelData
    {

        public class SortingNumChartPanelData
        {
            public class SpeedChartData : IPillarGroupObjectDataProvider
            {
                public long time;
                public int value;
                public int maxValue;

                public float GetSliderValue()
                {
                    return value / (float)maxValue;
                }

                public string GetDownText()
                {
                    var tdata = TimeUtil.FromTimestamp(time);
                    return tdata.Hour.ToString();
                }

                public string GetUpText()
                {
                    return value.ToString();
                }
            }

            public List<SpeedChartData> speedDatas;
        }

        public class SortingTimeChartPanelData
        {
            public class TimeChartData : IPillarGroupObjectDataProvider
            {
                public long time;
                public int value;
                public int maxValue;

                public float GetSliderValue()
                {
                    return value / (float)maxValue;
                }

                public string GetDownText()
                {
                    var tdata = TimeUtil.FromTimestamp(time);
                    return tdata.Hour.ToString();
                }

                public string GetUpText()
                {
                    return value.ToString();
                }
            }

            public List<TimeChartData> speedDatas;
        }

        public class SortingChartPanelData
        {
            public class SortingChartData : IPillarGroupObjectDataProvider
            {
                public long time;
                public int value;
                public int maxValue;

                public float GetSliderValue()
                {
                    return value / (float)maxValue;
                }

                public string GetDownText()
                {
                    var tdata = TimeUtil.FromTimestamp(time);
                    return tdata.Hour.ToString();
                }

                public string GetUpText()
                {
                    return value.ToString();
                }
            }

            public List<SortingChartData> speedDatas;
        }
    }

    public class CheckNumPanelData
    {

    }
}
    